package org.example;

/**
 * @author shichunyue
 * @date 2025-11-12 15:53
 */
public class Person {
    private String name;
    private int age;
    private Email email;
    private Hobby[] hobbies;

    // 必须提供无参构造函数（Jackson 需要）
    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
        this.email = email;
    }

    // Getter 和 Setter 方法 (Jackson 通过 getter/setter 访问属性)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Email getEmail() {
        return email;
    }

    public void setEmail(Email email) {
        this.email = email;
    }

    public Hobby[] getHobbies() {
        return hobbies;
    }

    public void setHobbies(Hobby[] hobbies) {
        this.hobbies = hobbies;
    }
}